using System;
using System.Web.UI.WebControls;
using ClickSocial.Framework;
using ClickSocial.DataSourceControls;
using System.Collections.Generic;
using System.Web.Security;

namespace ClickSocial.Admin
{
    public partial class UserManager : CDefault
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void Page_Init(object sender, EventArgs e)
        {
            EditUser1.UserEdited += new EventHandler(EditUser1_UserEdited);
            NewUser1.UserCreated += new EventHandler(NewUser1_UserCreated);
        }

        protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            NewUser1.Visible = false;
            EditUser1.Visible = true;
            EditUser1.Usuario = GridView1.Rows[e.NewEditIndex].Cells[0].Text;
            EditUser1.Cargar();
        }

        protected void EditUser1_UserEdited(object sender, EventArgs e)
        {
            EditUser1.Visible = false;            
            GridView1.DataBind();
        }

        protected void NewUser1_UserCreated(object sender, EventArgs e)
        {
            NewUser1.Visible = false;
            NewUser1.ResetControls();
            GridView1.DataBind();
        }

        protected void lnkbtnCrearUsuario_Click(object sender, EventArgs e)
        {
            NewUser1.Visible = true;
            EditUser1.Visible = false;
            NewUser1.ResetControls();
        }

        protected void ddlFiltrarPerfil_SelectedIndexChanged(object sender, EventArgs e)
        {
            UserODS.DataBind();
        }

      }
}
